image: golang:1.13

stages:
  - build
  - test

build:
  stage: build
  script:
    - go build ./...

test:
  stage: test
  script:
    - test -z "$(gofmt -l . | tee /dev/stderr)"
    - go test ./...
    - curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.21.0
    - golangci-lint run -v
